#pragma once
#include "MyWindow.h"
#include "tmxparser.h"

class MapRenderer
{
public:
	MapRenderer();
	~MapRenderer();
	MapRenderer(MyWindow *win,int w,int h,int l,int t);

	tmxparser::TmxReturn LoadMap();
	void LoadImage();
	void RenderLayer(const tmxparser::TmxLayer *it);
	void RenderUnderLayer();
	void RenderAboveLayer();
	void RenderCollisonLayer();

	void moveLeftTop(const int &plyrX, const int &plyrY);


	bool m_bRenderCollisonLayer = false;

public:

	int getMarginWidth(){ return m_iMarginWidth; }
	int getMarginHeight(){ return m_iMarginHeight; }
	tmxparser::TmxMap getMap(){ return m_Map; }
	int getZoomedTileWidth(){ return m_iZoomedTileWidth; }
	int getZoomedTileHeight(){ return m_iZoomedTileHeight; }
private:

	int m_iMapWidth, m_iMapHeight;
	int m_WinWidth, m_WinHeight;
	int m_iMarginWidth, m_iMarginHeight;
	int m_Left, m_Top;
	int m_iZoom, m_iZoomedTileWidth, m_iZoomedTileHeight;
	MyWindow *m_Window;
	tmxparser::TmxMap m_Map;
	tmxparser::TmxReturn m_Error;
	vector<SDL_Texture*> images;

};

